-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update blockchain readme example #836
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
}, | ||
(err) => console.log(err || 'Done.'), | ||
) | ||
blockchain.iterator('i', (block) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to leave the await
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the await would be useful for awaiting until the iterator is finished before moving onto the next line of code but since there is none I thought it’d be okay (and then I’d have to wrap it in an inner async func since you can’t await from the top level). I didn’t actually test it but I think it’ll work like that! Please correct me if I’m wrong :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess another option could be to add a .then(() => { console.log('Done.') }).catch(console.error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
This PR updates the blockchain example in the readme after the changes in #833.
Note: the geth example may not be working anymore due to changes to the geth db structure (see #745), so we may want to consider using another example here.